import 'dart:io';

main() {
  print('开始吧孩子');
  requestData().then((res) {
    print(res);
  }).catchError((error) {
    print('请求数据失败:$error');
  }).whenComplete(() {
    print('结束了嗷,我管你成功还是失败');
  });
  print('先运行其它代码,我先蓄力....');
}

Future<String> requestData() {
  return new Future(() {
    sleep(Duration(seconds: 5));
    throw '燃尽了';
  });
}
